﻿export const routeAuthCodes = {
  GLOBAL: 'global',
  STUDENT: 'STUDENT',
  TEACHER: 'TEACHER',
};

export default [
  {
    name: 'personal',
    path: '/personal',
    icon: 'icon-artist',
    access: routeAuthCodes.GLOBAL,
    routes: [
      {
        path: '/personal',
        redirect: '/personal/center',
      },
      {
        path: '/personal/center',
        name: 'center',
        component: './personal/center',
        access: routeAuthCodes.GLOBAL,
      },
    ]
  },
  {
    name: 'student',
    path: '/student',
    icon: 'icon-artist',
    access: routeAuthCodes.STUDENT,
    routes: [
      {
        path: '/student',
        redirect: '/student/course',
      },
      {
        path: '/student/course',
        name: 'course',
        component: './student/course',
        access: routeAuthCodes.STUDENT,
      },
      {
        path: '/student/program',
        name: 'program',
        component: './student/program',
        access: routeAuthCodes.STUDENT,
      },
    ],
  },
  {
    name: 'teacher',
    path: '/teacher',
    icon: 'icon-artist',
    access: routeAuthCodes.TEACHER,
    routes: [
      {
        path: '/teacher',
        redirect: '/teacher/course',
      },
      {
        path: '/teacher/course',
        name: 'course',
        component: './teacher/course',
        access: routeAuthCodes.TEACHER,
      },
      {
        path: '/teacher/class',
        name: 'class',
        component: './teacher/class',
        access: routeAuthCodes.TEACHER,
      },
      {
        path: '/teacher/question',
        name: 'question',
        component: './teacher/question',
        access: routeAuthCodes.TEACHER,
      },
    ],
  },
  {
    path: '/',
    redirect: '/personal',
    access: routeAuthCodes.GLOBAL,
  },
  {
    path: '/login',
    component: './login/index',
    layout: false,
    access: routeAuthCodes.GLOBAL,
  },
  {
    path: '/404',
    component: './404',
    access: routeAuthCodes.GLOBAL,
  },
];

